import { BaseWindow } from "../../../component/window/BaseWindow";
import { ILayer } from "../../../mvc/interfaces/ILayer";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { DataProvider } from "../../../../fl/data/DataProvider";
import { Language } from "../../../../extend/language/Language";
import { ScrollPolicy } from "../../../../fl/controls/ScrollPolicy";
import { PetIslandMapDiscardItemRenderer } from "./renderer/PetIslandMapDiscardItemRenderer";
import { LoaderHelp } from "../../../common/display/LoaderHelp";
import { ResFileConst } from "../../resource/ResFileConst";
import { GTileList } from "../../../../com/mui/controls/GTileList";
//class PetIslandMapDiscardPanel
    
    export  class PetIslandMapDiscardPanel extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            setSize(625, 501);
            titleHeight = 26;
            return;
        }

        /* internal  */onResCompl(): void
        {
            pushUIToDisposeVec(ObjCreate.createGBitmap(ImagesConst.PetIslandMapDiscardTitleText, 32, 88, this));
            return;
        }

        public set data(arg1: Array<any>)
        {
            this._list.dataProvider = new DataProvider(arg1);
            this._list.drawNow();
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            super.createDisposedChildrenImpl();
            pushUIToDisposeVec(ObjCreate.createFlowerBg(20, 38, 588, 120, this));
            pushUIToDisposeVec(ObjCreate.createBg(18, 161, 589, 328, this));
            pushUIToDisposeVec(ObjCreate.createGTextField(Language.getString(28165), 170, 55, 300, 20, this));
            pushUIToDisposeVec(ObjCreate.createFireTip(Language.getString(28166), 240, 120, this, true));
            this._list = ObjCreate.createTileList(28, 170, 580, 325, this);
            this._list.scrollPolicy = ScrollPolicy.OFF;
            this._list.columnWidth = 580;
            this._list.rowHeight = 53;
            this._list.setStyle("cellRenderer", PetIslandMapDiscardItemRenderer);
            LoaderHelp.addResCallBack(ResFileConst.PetIslandMapDiscard, this.onResCompl);
            return;
        }

        protected /* override */ disposeImpl(arg1: Boolean=true): void
        {
            super.dispose(arg1);
            this._list.dispose(arg1);
            this._list = null;
            return;
        }

        /* internal */ /* var */_list: GTileList;
    }
